import React from 'react';
import { Switch, Route } from 'react-router-dom';
import Loadable from 'react-loadable';

import Loading from '../components/Loading';


const Home = Loadable({
  loading: Loading,
  loader: () => import('../components/Home' /* webpackChunkName: 'home' */)
});
const About = Loadable({
  loading: Loading,
  loader: () => import('../components/About' /* webpackChunkName: 'about' */)
});

const App = () => {
  return (
    <Switch>
      <Route path="/home" component={Home} />
      <Route path="/about" component={About} />
    </Switch>
  );
};

export default App;
